<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Report extends Model
{
    protected $hidden = ['updated_at', 'created_at'];
    public function cityInfo()
    {
        return $this->belongsTo('App\Models\CityList', 'city', 'key');
    }

    public function statusArray($status = null)
    {
        $arr = [
            0 => "取消",
            10 => "新增",
            20 => "发布",
        ];
        if ($status !== null) {
            return array_key_exists($status, $arr) ? $arr[$status] : $arr['0'];
        }
        return $arr;
    }
}
